package com.cnunicom.modules.tra.service.impl;

import com.cnunicom.common.annotation.SysLog;
import org.apache.commons.lang.StringUtils;
import org.apache.ibatis.logging.Log;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cnunicom.common.utils.PageUtils;
import com.cnunicom.common.utils.Query;

import com.cnunicom.modules.tra.dao.RoomTypeDao;
import com.cnunicom.modules.tra.entity.RoomTypeEntity;
import com.cnunicom.modules.tra.service.RoomTypeService;


@Service("roomTypeService")
public class RoomTypeServiceImpl extends ServiceImpl<RoomTypeDao, RoomTypeEntity> implements RoomTypeService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {

        String floor = (String) params.get("floor");
        String name = (String) params.get("name");

        IPage<RoomTypeEntity> page = this.page(
                new Query<RoomTypeEntity>().getPage(params),
                new QueryWrapper<RoomTypeEntity>()
                        .like(StringUtils.isNotBlank(floor),"floor",floor)
                        .like(StringUtils.isNotBlank(name),"name",name)
        );

        return new PageUtils(page);
    }

}
